package com.example.designmode.command

import org.junit.Test


/**
 * 客户端
 *
 * @author zhouronghua
 * @time 2022/3/9 2:27 下午
 */
class Client {

    @Test
    fun testCommandMode() {
        // 创建一个订单
        var order1 = Order(1)
        order1.setFood("西红柿", 2)
        order1.setFood("蛋炒饭", 2)
        // 创建第二桌订单
        var order2 = Order(2)
        order2.setFood("青椒肉丝盖饭", 1)
        order2.setFood("可口可乐", 2)
        // 创建厨师
        val seniorChef = SeniorChef()
        val waiter = Waiter()
        // 为服务员添加订单
        waiter.addCommand(OrderCommand(seniorChef, order1))
        waiter.addCommand(OrderCommand(seniorChef, order2))
        // 执行订单处理
        waiter.orderUp()
    }
}